In general, a semiconductor integrated circuit operates by a crystal oscillation clock input from external. However, a crystal oscillator is easy to be broken because it is attached on a board and so on, and there is a case when a supply of a clock is stopped when the semiconductor integrated circuit is in operation. Accordingly, many microcontrollers perform a detection whether the clock input from external is stopped or not by using an oscillation clock of an oscillation circuit mounted inside a chip.
A method in which a reset (clear) is regularly input to a flip-flop in which a detection object clock is supplied and a certain output is set by detecting an edge of the detection object clock by using a detection clock, and the clock stop is detected by checking that the output of the flip-flop is not changed at the reset input time, is proposed as a method to detect the clock stop (for example, refer to Patent Document 1). Note that it is assumed that a frequency of the detection object clock is higher than a frequency of the detection clock in the technology discussed in Patent Document 1.
However, it is not easy in a conventional clock stop detection method to adjust a frequency ratio of the detection object clock and the detection clock by a circuit and a usable case is limited. Besides, the clock stop is detected by using the reset, and therefore, it is impossible to correspond to a circuit check tool such as an asynchronous verification when a clock stop detection unit is provided as a soft-macro (software macro).
[Patent Document 1] Japanese Laid-open Patent Publication No. 08-63449